<div class="row">
    <h2>User Registration</h2>
    <hr/>
    <div class="alert alert-success" *ngIf="success">Registed successfully!</div>
    <form [formGroup]="formGroup" (ngSubmit)="doRegister()">
        <div class="form-group">
            <label for="username">User name</label>
            <input type="email" class="form-control" id="username" placeholder="User name" formControlName="username">
            <div *ngIf="formErrors.username" class="text-danger">
                {{ formErrors.username }}
            </div>
        </div>
        <div class="form-group">
            <label for="password">Password</label>
            <input type="password" class="form-control" id="password" placeholder="Password" formControlName="password">
        </div>
        <div class="form-group">
            <label for="password">Confirm Password</label>
            <input type="password" class="form-control" id="confirmPassword" placeholder="Confirm Password" formControlName="confirmPassword">
        </div>
        <button type="submit" class="btn btn-primary">Submit</button>
        <a routerLink="/auth/login" class="btn btn-default">Go to Login</a>
    </form>
</div>
